<template>
  <wd-tag :type="data[0].typeValue" custom-class="px-8rpx! py-6rpx! mr-5" plain>{{ data[0].label }}</wd-tag>
  <wd-tag :type="data[1].typeValue" custom-class="px-8rpx! py-6rpx!" plain>{{ data[1].label }}</wd-tag>
</template>

<script lang="ts" setup>
import { ref, defineProps } from 'vue'
interface TagType {
  label: string
  type?: number
  value?: number
  typeValue: 'default' | 'primary' | 'danger' | 'warning' | 'success'
}
const props = defineProps({
  type: {
    type: Number,
    default: 0
  },
  value: {
    type: Number,
    default: 0
  }
})
const tagItem = ref<TagType[]>([
  { label: '勘察单', type: 0, typeValue: 'primary' },
  { label: '施工单', typeValue: 'success', type: 1 },
  { label: '异常单', typeValue: 'danger', type: 2 }
])
const tagType = ref<TagType[]>([
  { label: '待启动', typeValue: 'warning', value: -1, type: 0 },
  { label: '预勘察', typeValue: 'warning', value: 0, type: 0 },
  { label: '开始勘察', typeValue: 'primary', value: 1, type: 0 },
  { label: '勘察整改', typeValue: 'danger', value: 2, type: 0 },
  { label: '勘察撤离', typeValue: 'success', value: 3, type: 0 },
  { label: '预施工', typeValue: 'warning', value: 0, type: 1 },
  { label: '开始施工', typeValue: 'warning', value: 1, type: 1 },
  { label: '暂停施工', typeValue: 'danger', value: 2, type: 1 },
  { label: '调试', typeValue: 'primary', value: 3, type: 1 },
  { label: '试运行', typeValue: 'success', value: 4, type: 1 },
  { label: '施工完成', typeValue: 'success', value: 5, type: 1 }
])
const data = computed(() => {
  return [
    tagType.value.find(
      (item: TagType) => (item.type === props.type && item.value === props.value) || props.value == -1
    ),
    tagItem.value.find(item => item.type === props.type)
  ]
})
</script>

<style lang="scss" scoped></style>
